<template>
	<div class="wrap-top">
		<div class="wrap-top-item" v-if="hasLeft">
			<div class="item-left">
				<el-icon color="#003366" :size="20">
					<Search />
				</el-icon>
				<span class="opt-name">筛选</span>
			</div>
			<div class="item-right">
				<slot name="search"></slot>
			</div>
		</div>
		<div class="wrap-top-item">
			<div class="item-left">
				<el-icon color="#003366" :size="20">
					<CirclePlus />
				</el-icon>
				<span class="opt-name">操作</span>
			</div>
			<div class="item-right">
				<slot name="add"></slot>
				<div class="opt-item">
					<el-button @click="onRefresh" type="primary" size="medium">刷新</el-button>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	import {
		CirclePlus,
		Search
	} from '@element-plus/icons'
	import mixin from '@/mixin.js'

	export default {
		mixins: [mixin],
		components: {
			CirclePlus,
			Search
		},
		data() {
			return {
				hasLeft: this.has_left
			}
		},
		props: ['has_left'],
		watch: {
			has_left(val) {
				this.hasLeft = val;
			}
		}
	}
</script>

<style>
</style>
